home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / mhis020.zip / CALLSTAT.MEX < prev    next >
Text File  |  1996-12-21  |  955b  |  39 lines

  1. #include <max.mh>
  2. #include <input.mh>
  3. #include "callavg.mh"
  4. #include "callcrit.mh"
  5. #include "callers.mh"
  6. #include "callutil.mh"
  7.  
  8. int main () {
  9.   string: temp;
  10.   long: start, end;
  11.   struct _callstats: stats;
  12.  
  13.   read_callers ();
  14.   if (call_open() = False) {
  15.     print ("Cannot open callers.dat!!\n");
  16.     };
  17.  
  18.   print (COL_WHITE, "Starting call, date, or <enter> for first: ", COL_CYAN);
  19.   readstr (temp);
  20.   start := caller_index_forward (temp);
  21.  
  22.   print (COL_WHITE, "Ending call, date, or <enter> for last: ", COL_CYAN);
  23.   readstr (temp);
  24.   end   := caller_index_backward (temp);
  25.  
  26.   stats_average (stats, start, end);
  27.   print (COL_WHITE + "Totals:\n");
  28.   stats_show (stats, 1);
  29.   if (stats.calls) {
  30.     print (COL_WHITE + "\n\nAverage per call:\n");
  31.     stats_show (stats, stats.calls);
  32.     print (COL_WHITE + "\n\nAverage per day:\n");
  33.     stats_show (stats, stats.days);
  34.     };
  35.   print ("\n");
  36.   call_close ();
  37.   }
  38.  
  39.